<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
	<title>
		同城易
	</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="/exchange/Public/css/bootstrap.min.css">
	<script type="text/javascript" src='/exchange/Public/js/jquery-3.1.1.min.js'></script>
	<script type="text/javascript" src='/exchange/Public/js/bootstrap.min.js'></script>
	
	<style type="text/css">
	     body{
	     	background-color: rgb(238,239,241);
	     }
	    #bread{
            list-style-type: none;
            width: 100%;
            height: 80px;
            background-color: white;
        }
        #bread li{
            float: left;
        }
        #myTab li{
		margin-left: 265px;
	}


	.product{
        	width: 85%;
        	height: 130px;
        	background-color: white;
        	margin: 10px auto;
        	padding: 20px;
        	float: left;
        	margin-left: 100px;
        	cursor: pointer;
        }
        .page{
            width: 85%;
        	height: 20px;
        	background-color: white;
        	margin: 10px auto;
        	padding: 20px;
        	float: left;
        	margin-left: 100px;
        }
        .product img{
        	width: 150px;
        	height: 100px;
        	float: left;

        }
        .product ul{
        	list-style-type: none;
        	margin-left: 120px;
        	margin-top: -12px;
        }
        .product ul li{
        	margin-top: 10px;
        }
        .product ul li label{
            font-size: 22px;
            font-weight: bold;
        }
        .info{
        	color: rgb(153,153,153);
        }
        #tips{
        	width: 16%;
        	height: 200px;
        	float: right;
        	background-color: white;
        	margin-right: 40px;
        	margin-top: 10px;
        	
        }
        #tips img{
        	width: 100%;
        	height: 200px;
        }
        
       .qiugou_content{
            width: 85%;
            height: 60px;
            background-color: white;
            margin: 5px auto;
        }
        .qiugou_content ul{
            list-style-type: none;
        }
        .qiugou_content ul li{
            float: left;
            
        }
        .qiugou_content ul li span a{
            font-size: 22px;
            float: left;

            line-height: 60px;
            font-weight: 600;
            text-decoration: none;
        }
        .qiugou_content ul li span a:link{
            color:rgb(0,0,0);
        }
        .qiugou_content ul li span a:hover{
           color: rgb(255,68,102);
           text-decoration: underline;
        }
        .qiugou_content ul li div{
            border: 1px solid black;
            margin-top: 18px;
            float: left;
           margin-left: 20px;
        }
        .price{
            font-weight: bold;
            color: rgb(255,68,102);
            margin-left: 200px;
            margin-top: 15px;
            font-size: 24px;
        }
        .area{
            color: rgb(193,168,153);
            
            margin-left: 200px;
            margin-top: 20px;
            font-size: 18px;
        }
        .date{
            
            color: rgb(193,168,153);
            margin-left: 200px;
            margin-top: 20px;
            font-size: 18px;
        }
         .row{
            width: 85%;
            margin: 5px auto;
        }
	</style>
</head>
<body>
<!--头顶开始-->
<nav class="navbar navbar-default" role="navigation"> 
    <div class="container-fluid"> 
        <div class="navbar-header"> 
            <a class="navbar-brand" href="#">同城二手交易平台</a> 
        </div> 
    <ul class="nav navbar-nav navbar-right">
    <?php if(empty($user)): ?><li><a href="#" id="login_error"><span class="glyphicon glyphicon-log-in">&nbsp;</span>登录</a></li>
            <script type="text/javascript">
              $("#login_error").click(function(){
                location.href="http://localhost/exchange/index.php/Home/user";
              })
            </script>
            <?php else: ?>
            <li><a href="#"><span class="glyphicon glyphicon-log-in">&nbsp;</span><?php echo ($user); ?></a></li><?php endif; ?>
    <?php if(empty($user)): ?><li>
            <a href="#" id="register_error"><span class="glyphicon glyphicon-user">&nbsp;</span>注册</a>
            </li>
            <script type="text/javascript">
               $("#register_error").click(function(){
                location.href="http://localhost/exchange/index.php/Home/user";
              })
            </script>
            <?php else: ?>
           <li> <a href="#"><span class="glyphicon glyphicon-user">&nbsp;</span>注册</a></li><?php endif; ?>
        </ul> 
    </div> 
</nav>
<!--头顶结束-->
<!--面包屑导航-->
<ul id="bread">
    <li><img src="/exchange/Public/images/logo.png" style="width: 180px;height: 80px;cursor: pointer;" id="back"></li>
    <li style="font-size: 25px;height: 80px;line-height: 80px;">></li>
    <li style="font-size: 25px;height: 80px;line-height: 80px;"><?php echo ((isset($search) && ($search !== ""))?($search): '不限'); ?></li>
</ul>
<script type="text/javascript">
        $("#back").click(function(){
            window.location.href="http://localhost/exchange/";
        })
    </script>
<!--面包屑导航-->
<ul id="myTab" class="nav nav-tabs">
    <li class="active">
        <a href="#ershou" data-toggle="tab">
            二手精品
        </a>
    </li>
    <li>
         <a href="#qiugou" data-toggle="tab">求购信息
        </a>
    </li>
    <li>
         <a href="#exchange" data-toggle="tab">以物换物
        </a>
    </li>
</ul>
<div id="myTabContent" class="tab-content">
 <!--二手精品-->
    <div class="tab-pane fade in active" id="ershou">

    <?php if(is_array($ershou_data)): foreach($ershou_data as $key=>$val): ?><div class="product">
        	<img src="/exchange/Public/<?php echo ($val["url"]); ?>">
        	<a href="/exchange/index.php/home/index/detail?id=<?php echo ($val["id"]); ?>" style="text-decoration: none;">
        	<ul>
        		<li><label><?php echo ($val["desc"]); ?></label><div style="border: 1px solid gray;float: left;color: gray"><?php echo ($val["kind"]); ?></div><div style="font-size: 22px;color: red;font-weight: bold;float: right;"><?php echo ($val["price"]); ?></div></li>
        		<li class="info"><?php echo ($val["area"]); ?></li>
        		<li class="info"><?php echo ($val["user"]); ?>/<?php echo (date('y-m-d',$val["createtime"])); ?></li>
        	</ul>
        	</a>
        </div><?php endforeach; endif; ?>
    
    </div>
    <!--二手精品-->
    <!--求购信息-->
    <div class="tab-pane fade" id="qiugou">
     <?php if(is_array($qiugou_data)): foreach($qiugou_data as $key=>$qiugou_val): ?><div class="qiugou_content">
        <ul>
            <li><span><a href="/exchange/index.php/home/index/qiugou?id=<?php echo ($qiugou_val["id"]); ?>"><?php echo ($qiugou_val["desc"]); ?></a></span><div><?php echo ($qiugou_val["kind"]); ?></div></li>
            <li class="price"><?php echo ($qiugou_val["price"]); ?></li>
            <li class="area"><?php echo ($qiugou_val["area"]); ?></li>
            <li class="date"><?php echo (date('y-m-d',$qiugou_val["createtime"])); ?></li>
        </ul>
    </div><?php endforeach; endif; ?>
    </div>
    <!--求购信息-->

    <!--以物换物-->
    <div class="tab-pane fade" id="exchange">
        <div class="row">
            <?php if(is_array($exchange_data)): foreach($exchange_data as $key=>$exchange_val): ?><div class="col-sm-6 col-md-3">
                    <div class="thumbnail">
                        <img src="/exchange/<?php echo ($exchange_val["url"]); ?>"
                             alt="通用的占位符缩略图">
                        <div class="caption">
                            <h3>换品：<?php echo ($exchange_val["desc"]); ?></h3>
                            <p>我想换：<?php echo ($exchange_val["product"]); ?></p>
                            <p>时间：<?php echo (date('y-m-d',$exchange_val["createtime"])); ?></p>
                            <p>类别：<?php echo ($exchange_val["kind"]); ?></p>
                            <p>地区：<?php echo ($exchange_val["area"]); ?></p>
                            <p>
                                <a href="/exchange/index.php/home/index/jiaohuan?id=<?php echo ($exchange_val["id"]); ?>" class="btn btn-primary" role="button">
                                    去看看
                                </a>
                            </p>
                        </div>
                    </div>
                </div><?php endforeach; endif; ?>
</div>
    <!--以物换物-->
    </div>
    </div>
<!--Tab-->
</body>
</html>
<script type="text/javascript">
    $(".qiugou_content").hover(function(){
        $(this).css('background-color','rgb(252,252,252)');
    },function(){
            $(this).css('background-color','white');
    })
</script>